package reg.domain;

import java.sql.Date;
import java.util.List;

import reg.data.JDBCNoticiaDAO;

public class NoticiaManager {

	private static NoticiaManager nm;
	private static List<Noticia> noticias;
	
	
	public static synchronized NoticiaManager getInstance(){
        if (nm == null){
            nm = new NoticiaManager();
        }
        return nm;
    }
	
	
	private NoticiaManager() {
		
	}

	
	public List<Noticia> getNoticias() {
		noticias = (new JDBCNoticiaDAO()).seleccionaTodasNoticias();
		return noticias;
	}

	
	public List<Noticia> getNoticiasDesde(Date fecha){
		return (new JDBCNoticiaDAO()).seleccionaNoticiasAPartirDeFecha(fecha) ;
	}
		
}
